package wiki.liven.dto;

/**
 * Created by qiangjun on 2016/10/21.
 * 输出秒杀地址DTO
 */
public class Exposer {

    private boolean exposered;

    private Long secKillId;

    private String md5;

    private Long now;

    private Long start;

    private Long end;

    /**
     * 秒杀没有开启，
     * 输出倒计时和秒杀开始时间
     * @param exposered
     * @param now
     * @param start
     * @param end
     */
    public Exposer(boolean exposered, long secKillId,Long now, Long start, Long end) {
        this.exposered = exposered;
        this.secKillId = secKillId;
        this.now = now;
        this.start = start;
        this.end = end;
    }

    /**
     * 秒杀开启后，输出秒杀地址，
     * 秒杀地址有seckillId和MD5生成
     * @param exposered
     * @param secKillId
     * @param md5
     */
    public Exposer(boolean exposered,long secKillId,String md5){
        this.exposered = exposered;
        this.secKillId = secKillId;
        this.md5 = md5;
    }

    /**
     * 当秒杀产品不存在，输出该类
     * @param exposered
     * @param secKillId
     */
    public Exposer(boolean exposered, Long secKillId) {
        this.exposered = exposered;
        this.secKillId = secKillId;
    }

    public boolean isExposered() {
        return exposered;
    }

    public void setExposered(boolean exposered) {
        this.exposered = exposered;
    }

    public Long getSecKillId() {
        return secKillId;
    }

    public void setSecKillId(Long secKillId) {
        this.secKillId = secKillId;
    }

    public String getMd5() {
        return md5;
    }

    public void setMd5(String md5) {
        this.md5 = md5;
    }

    public Long getNow() {
        return now;
    }

    public void setNow(Long now) {
        this.now = now;
    }

    public Long getStart() {
        return start;
    }

    public void setStart(Long start) {
        this.start = start;
    }

    public Long getEnd() {
        return end;
    }

    public void setEnd(Long end) {
        this.end = end;
    }

    @Override
    public String toString() {
        return "Exposer{" +
                "exposered=" + exposered +
                ", secKillId=" + secKillId +
                ", md5='" + md5 + '\'' +
                ", now=" + now +
                ", start=" + start +
                ", end=" + end +
                '}';
    }
}
